<?php
error_reporting(0);
require_once('lib.php');
session_start();
if(login()){
	$log = true;
}else{
	$log = false;
}

if($log){
?>
<table cellpadding="5" cellspacing="0" border="0">
<tr><td class="topic">ผู้ดำรงตำแหน่ง</td><td>:</td><td>
<span id="pname_dat">
<?php
    $pos = list_position1($_GET['depart']);
    echo "<select name=\"pname\" size=\"1\">\n";	
	if($pos==0) echo "<option value=\"0\">ไม่มีผู้ดำรงตำแหน่ง</option>";
	else{	
	    $ans = getPG("select * from view_pname where position_id=".$pos.";");

	    foreach($ans as $dat){
		    echo "<option value=\"".$dat['pname_id']."\">".$dat['pname_name']."</option>\n";
	    }
	
    }
    echo "</select>\n";

?>
</span>
</td></tr>
<tr><td class="topic">ตำแหน่ง</td><td>:</td><td>
<select name="position" size="1" id="xposition" onchange="pnamech()">
<?php list_position_option($_GET['depart']); ?>
</select>
</td></tr>

<tr><td colspan="3">
<optgroup label="ksean_op">
<input type="radio" name="ksean_op" value="0" checked >ยังไม่ได้เกษียณ &nbsp;&nbsp;&nbsp;
<input type="radio" name="ksean_op" value="1" >เกษียณแล้ว &nbsp;&nbsp;&nbsp;
</optgroup>
</td></tr>
</table>

<?php
}else{
	echo "Sorry ! ....";
}
?>
